package com.accompany.controller;


import com.accompany.common.result.CommonResult;
import com.accompany.model.Dict;
import com.accompany.service.DictService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 字典表 前端控制器
 * </p>
 *
 * @author lfs
 * @since 2023-03-08
 */
@Api(tags = {"字典接口"})
@RestController
@RequestMapping("/dict")
public class DictController {

    @Autowired
    DictService service;

    @ApiOperation("获取字典系 parent_id：0 所有医院")
    @GetMapping(value = "getDices")
    public CommonResult<List<Dict>> getDice(Long parentId){
        return CommonResult.success(service.getDicts(parentId));
    }
}
